Results 1 to 2 of 2

Thread: Add Apply Button to Menu

  1. #1

    Default Add Apply Button to Menu

    I have a menu used by guests to easily connect to my servers. The guests type the server password into the password field, press enter, and click the server they wish to join from the list. There is occasionally an issue with guests not understanding to press "enter" between inputting the password and clicking the server to join (yes, even though it's in big yellow letters right on the menu). I'd like to add an "Apply" button which links the password typed into the field to the "password" variable in order to eliminate some of the confusion. Is this possible?

    Here's the menu:
    Click image for larger version. 

Name:	connect.jpg 
Views:	10 
Size:	37.3 KB 
ID:	1711

    Here's the code:
    menu "cbconnect" 382 334 FROM_TOP 0 //0.2
    rect 0 0 450 170
    fadein 0.05
    virtualres 1
    
    resource
    Label
    {
    title "[cB] Guest Connect Menu 1.2"
    name "Default"
    rect 0 0 450 20
    fgcolor 1.00 1.00 1.00 1.00
    bgcolor 0.00 0.00 0.00 0.75
    borderstyle "RAISED"
    }
    
    resource
    Button
    {
        title "[cB] Custom Maps"
        textalign left
        name "Default"
        rect 0 20 450 20
        fgcolor 0 0 0
        bgcolor .1 .1 .5
        borderstyle "3D_BORDER"
        shader "menu_button_trans"
        stuffcommand "connect 74.91.119.152:12203"
    }
    
    resource
    Button
    {
        title "[cB] Private Server"
        textalign left
        name "Default"
        rect 0 40 450 20
        fgcolor 0 0 0
        bgcolor .1 .1 .5
        borderstyle "3D_BORDER"
        shader "menu_button_trans"
        stuffcommand "connect 74.91.119.195:12203"
    }
    
    resource
    Button
    {
        title "[cB] Public Server"
        textalign left
        name "Default"
        rect 0 60 450 20
        fgcolor 0 0 0
        bgcolor .1 .1 .5
        borderstyle "3D_BORDER"
        shader "menu_button_trans"
        stuffcommand "connect 74.91.119.151:12203"
    }
    
    resource
    Button
    {
        title "[cB] Test Server"
        textalign left
        name "Default"
        rect 0 80 450 20
        fgcolor 0 0 0
        bgcolor .1 .1 .5
        borderstyle "3D_BORDER"
        shader "menu_button_trans"
        stuffcommand "connect 74.91.119.191:12203"
    }
    
    
    resource Label {
    title "Password"
    name "Default"
    rect 0 100 100 20
    fgcolor 0.00 0.00 0.00 1.00
    bgcolor 0.50 0.50 0.50 1.00
    borderstyle "3D_BORDER"
    }
    
    resource Field {
    name "Default"
    rect 100 100 350 20
    fgcolor 0.00 0.00 0.00 1.00
    bgcolor 1.00 1.00 1.00 1.00
    borderstyle "3D_BORDER"
    stuffcommand "password "
    shader "menu_button_trans"
    hovershader "menu_button_glow"
    }
    
    resource Label {
    title "IP"
    name "Default"
    rect 0 120 100 20
    fgcolor 0.00 0.00 0.00 1.00
    bgcolor 0.50 0.50 0.50 1.00
    borderstyle "3D_BORDER"
    }
    
    resource Field {
    name "Default"
    rect 100 120 350 20
    fgcolor 0.00 0.00 0.00 1.00
    bgcolor 1.00 1.00 1.00 1.00
    borderstyle "3D_BORDER"
    stuffcommand "connect "
    shader "menu_button_trans"
    hovershader "menu_button_glow"
    }
    
    resource Label {
    title "Enter the password in the password area and press enter."
    name "Default"
    rect 0 140 450 15
        fgcolor 0 0 0
        bgcolor .1 .1 .5
    borderstyle "NONE"
    textalign center
    }
    
    resource Label {
    title "Click the server above you would like to join, or type an IP and press enter to connect."
    name "Default"
    rect 0 155 450 15
        fgcolor 0 0 0
        bgcolor .1 .1 .5
    borderstyle "NONE"
    textalign center
    }
    
    
    
    end

  2. #2

    Default

    To do that you have to change the IP and Password field like this:
    resource Field {
    name "Default"
    rect 100 100 350 20
    fgcolor 0.00 0.00 0.00 1.00
    bgcolor 1.00 1.00 1.00 1.00
    borderstyle "3D_BORDER"
    linkcvar "password"
    //stuffcommand "password "
    shader "menu_button_trans"
    hovershader "menu_button_glow"
    }
    
    resource Field {
    name "Default"
    rect 100 120 350 20
    fgcolor 0.00 0.00 0.00 1.00
    bgcolor 1.00 1.00 1.00 1.00
    borderstyle "3D_BORDER"
    linkcvar "ip"
    //stuffcommand "connect "
    shader "menu_button_trans"
    hovershader "menu_button_glow"
    }


    and on the Apply button you put this:

    stuffcommand "menupassword password;menuconnect ip"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •